package com.jlastu.androidsx.model;

import android.app.Application;
import android.content.Context;
import android.content.Intent;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;

import com.jlastu.androidsx.ui.user.UserInfoActivity;


public class MeModel extends AndroidViewModel {
    private Context context;
    public MeModel(@NonNull Application application) {
        super(application);
        this.context = application;
    }

    /**
     * 用户信息
     */
    public void userInfo(){
        context.startActivity(new Intent(context, UserInfoActivity.class));
    }


    public void setting(){
//        context.startActivity(new Intent(context, SettingActivity.class));
    }

    public void logout(){
        try {
            // 正常退出，结束当前进程
            android.os.Process.killProcess(android.os.Process.myPid());
            // 退出应用程序
            System.exit(0);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
